var OrderingSystem = function(){
    var url = '1.php';
  var request = function (out, successFunction, errorFunction, completeFunction) {
      var request = new AjaxRequest(url, JSON.stringify(out), function (data, textStatus) {
    /*      if (data.error) {
              alert("error:" + data.error + "errmsg" + data.errmsg[0]);
              console.error("server logic error:", data, 'caused by:', out);
          }

          for (var i in data["cookieData"]) {
              if (data["cookieData"].hasOwnProperty(i)) {
                  localStorage.setItem(i, JSON.stringify(data["cookieData"][i]));
              }
          }*/

          if (typeof successFunction !== 'undefined') {
              successFunction(data, textStatus);
          }
      }, function (XMLHttpRequest, textStatus, errorThrown) {
          if (typeof errorFunction === 'undefined') {
              //console.error("AjaxRequestError:", "XMLHttpRequest:", XMLHttpRequest, 'textStatus:', textStatus, "errorThrown:", errorThrown);
          } else {
              errorFunction(XMLHttpRequest, textStatus, errorThrown);
          }
      }, function (XMLHttpRequest, textStatus) {
          if (typeof completeFunction === 'undefined') {
              //console.info("AjaxRequestComplete:", "XMLHttpRequest:", XMLHttpRequest, 'textStatus:', textStatus);
          } else {
              completeFunction(XMLHttpRequest, textStatus);
          }
      });


      request.doAjax();
  };
    return{
         getData:function(options){
             var out = {
                 "params"    : {},
                 "controller": "home",
                 "action"    : "getWindPath"
             };
             request(out,options.successFunction, options.errorFunction, options.completeFunction)
         }
    }
}();